<ui:composition template="/WEB-INF/templates/public-template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	
	<ui:define name="sidebar">
		<ui:include src="/WEB-INF/templates/public-sidebar.xhtml" />
	</ui:define>
	<ui:define name="content">
		<h:form>
			
			<h:panelGrid columns="1" >
			 <h:outputText value="Leave Approval" styleClass="outputTextTitle" />
				
				<h:panelGrid columns="6" style="border: 1px solid #d9d9d9;width: 100%" cellspacing="10">
				  <h:outputLabel value="#{msg['employeeidoremployeename.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace>  
	                       <p:inputText value="#{approveLeaveBean.employeeLeave.employee.firstName}/#{approveLeaveBean.employeeLeave.employee.employeeCode}" readonly="true"/>  
	                </p:inplace>
					
				
					<h:outputLabel value="#{msg['modulename.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace>  
	                       <p:inputText value="#{approveLeaveBean.employeeLeave.employee.moduleName}" readonly="true"/>  
	                </p:inplace>
					  
	                <h:outputLabel value="#{msg['projectname.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace>   
	                       <p:inputText value="#{approveLeaveBean.employeeAndReporting.project}" readonly="true"/>  
	                </p:inplace>
	                <h:outputLabel value="#{msg['leavetype.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace>  
	                       <p:inputText value="#{approveLeaveBean.employeeLeave.leaveType.leaveType}" readonly="true"/>  
	                </p:inplace>
					<h:outputLabel value="#{msg['leaveappliedon.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace >   
	                       <p:inputText value="#{approveLeaveBean.employeeLeave.appliedOn}" readonly="true">
	                        <f:convertDateTime pattern="dd-MMM-yyyy"/>
	                       </p:inputText>  
	                </p:inplace>
	               
	                <h:outputLabel value="#{msg['timetnterval.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace >   
	                       <p:inputText value="#{approveLeaveBean.leaveFromToBeDisplayed} to #{approveLeaveBean.leaveToToBeDisplayed}" readonly="true"/> 
	                </p:inplace>
	                <h:outputLabel  value="#{msg['nodays.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace >   
	                       <p:inputText value="#{approveLeaveBean.employeeLeave.noOfDays}" readonly="true"/> 
	                </p:inplace>
	              
	                
	                 <h:outputLabel  value="#{msg['tomail.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace >   
	                       <p:inputText value="#{approveLeaveBean.employeeLeave.employee.email}"/> 
	                       
	                </p:inplace>
	             
	                <h:outputLabel  value="#{msg['availablecontactnumber.lable']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace >   
	                       <p:inputText value="#{approveLeaveBean.employeeLeave.availableContactNumber}" readonly="true"/> 
	                       
	                </p:inplace>
	               
	                <h:outputLabel value="#{msg['availableaddress.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace>  
	                       <p:inputTextarea value="#{approveLeaveBean.employeeLeave.availableAddress}" readonly="true"/> 
	                </p:inplace>
	                 <h:outputLabel  value="#{msg['reasonforleave.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace>  
	                       <p:inputTextarea value="#{approveLeaveBean.employeeLeave.reason}" readonly="true"/> 
	                </p:inplace>
	               
				    <h:panelGroup>
	                 <h:outputLabel value="*" style="color:red;" />	
					<h:outputLabel value="#{msg['approverscomments.label']}" style="font-size: 12px;" />
					</h:panelGroup>
					<h:outputLabel value=" : " />				
					  
	                        <p:inputTextarea value="#{approveLeaveBean.employeeLeave.approvalComments}" rendered="#{approveLeaveBean.leaveApprovedFlag}"/>
	                        <p:inputTextarea value="#{approveLeaveBean.employeeLeave.approvalComments}" readonly="true" rendered="#{not approveLeaveBean.leaveApprovedFlag}"/>  
	               <h:inputHidden/>
	               <h:inputHidden/>
	               <h:inputHidden/>
					<h:inputHidden/>
					<h:inputHidden/>
					<h:panelGroup rendered="#{approveLeaveBean.leaveApprovedFlag}">
	                <p:commandButton  value="Approve"  id="Approve" actionListener="#{approveLeaveBean.approveRejectLeaveAction}" update="growl" disabled="#{approveLeaveBean.employeeLeave.approvalStatus eq 'APPROVED' or approveLeaveBean.employeeLeave.approvalStatus eq 'REJECTED'}"/> 
					<p:commandButton  value="Reject"  id="Reject" actionListener="#{approveLeaveBean.approveRejectLeaveAction}" update="growl" disabled="#{approveLeaveBean.employeeLeave.approvalStatus eq 'APPROVED' or approveLeaveBean.employeeLeave.approvalStatus eq 'REJECTED'}"/>
					</h:panelGroup>
				   <h:inputHidden/>   
				   <h:inputHidden/> 
				</h:panelGrid>
				 <h:panelGroup>
			       <h:outputText value="LEAVE APPROVED ALREADY" style="color: #7892B7;font-size:14px;font:bold;" rendered="#{approveLeaveBean.employeeLeave.approvalStatus eq 'APPROVED'}"/>
			       <h:outputText value="LEAVE REJECTED" style="color: #7892B7;font-size:14px;font:bold;" rendered="#{approveLeaveBean.employeeLeave.approvalStatus eq 'REJECTED'}"/>
			       
			       </h:panelGroup>
                 <h:panelGroup rendered="#{approveLeaveBean.leaveApprovedFlag}">
				 <h:outputLabel value="Note:Approving leave will automatically send an email to mail id specified above with comments." 
				 style="color: #7892B7;font-size:12px;"/>
				</h:panelGroup>	
				 
			</h:panelGrid>    
			
			 <h:panelGrid columns="1">
			 
			 </h:panelGrid>
			
			<p:growl id="growl"/>
		</h:form>
	</ui:define>
</ui:composition>

